package com.tjsinfo.tjsoa.workTask.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.workTask.bo.ITDailyWorkTaskBO;

public class WorkTaskDelAction extends Action {
	private ITDailyWorkTaskBO workTaskBo;
	
	public void setWorkTaskBo(ITDailyWorkTaskBO workTaskBo) {
		this.workTaskBo = workTaskBo;
	}
	
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		try {
			String id = request.getParameter("id");
			workTaskBo.delete(id);
			request.setAttribute("linkurl", "daily/workTask/workTaskList.jsp?dividerUserid=dividerUserid");
			request.setAttribute("message", "system.save.message");
			return mapping.findForward("success");
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			request.setAttribute("Exception", e);
			return mapping.findForward("failed");
		}
	}
}
